<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <img id="img" style="width: 400px; height: 400px;
    position: fixed; left: 50%; margin-left: -200px" src="https://login.weixin.qq.com/qrcode/{{ uuid }}">
    <script src="/static/jquery-1.12.4.js"></script>
    <script>
        $(function () {
            check_login();
        });
        /* to simulate a long conn*/
        function check_login() {
            $.ajax({
                url:'check_login.html',
                type:'GET',
                data:{},
                dataType: 'json',  /*parse the returned data by json format*/
                success: function (arg) {
                    if(arg.code==408){
                        check_login();
                    }else if(arg.code==201) {
                        $("#img").attr('src',arg.data);
                        check_login();
                    }else {
                        location.href = "/index.html";
                    }

                }

            })
        }
    </script>
</body>
</html>